package com.jnu.myaccount_drawer.ui.manage;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.jnu.myaccount_drawer.R;

public class DetailActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);

        Intent intent = getIntent();
        int position = intent.getIntExtra("position",0);

        String type = intent.getStringExtra("type");//取数据
        Double price = intent.getDoubleExtra("price",0);
        String payType=intent.getStringExtra("payType");
        String payOrIncome=intent.getStringExtra("payOrIncome");
        String date=intent.getStringExtra("date");
        int pictureId=  intent.getIntExtra("pictureId",0);

        TextView textViewAccountNumber=findViewById(R.id.text_view_account_number);
        textViewAccountNumber.setText(price+"");

        TextView textViewTypeNumber=findViewById(R.id.text_view_type_number);
        textViewTypeNumber.setText(type);

        TextView textViewInOrOutType=findViewById(R.id.text_view_inOrOut_type);
        textViewInOrOutType.setText(payOrIncome);

        TextView textViewAccountType=findViewById(R.id.text_view_account_type_type);
        textViewAccountType.setText(payType);

        TextView textViewDate=findViewById(R.id.text_view_date_num);
        textViewDate.setText(date);

        ImageView imageViewPicture=findViewById(R.id.image_view_picture);
        imageViewPicture.setImageResource(pictureId);

        Button buttonBack=findViewById(R.id.button_back);
        buttonBack.setOnClickListener(view -> finish());
    }
}